package com.rd.student.jiaji.class3.zhangshixuan;

import java.util.Scanner;

public class Demo01 {
    public static void main(String[] args) {
        System.out.println("请输入金字塔层数:");
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        for (int i = 1; i <= a; i++) {
            for (int j = 1; j <= a-i; j++) {
                System.out.print(" ");
            }
            for (int x = 1; x <= 2 * i-1; x++) {
                System.out.print("*");
            }
            System.out.println("");
        }
    }
}
